import 'dart:convert';

import 'package:full_display/unit/http/http_callback.dart';
import 'package:full_display/unit/http/http_utils.dart';
import 'package:full_display/unit/http/response_type.dart';

class RegisterApi {

  Future<void> postRegister(String phone,String email, String password,String configPassword,
      {Success? success, Failure? failure}) async {
    var languageStr = 'en';
    if (phone.contains('+86')) {
      languageStr = 'zh-cn';
    }

    var param = {
      'Mobile': phone,
      'Email': email,
      'Password': password,
      'ConfirmPassword': configPassword,
      'language': languageStr,
    };

    // String s=jsonEncode(param);

    await HttpUtils.instance.post('https://mrjump.po75.com:6240/Api/User/Register',
        body: param, onSuccess: success, onFailure: failure,responseType: QbResponseType.none);
  }

  /**
   * console.log(this.yzcode)
      console.log(this.userId)
      console.log(this.mobile)
      console.log(this.email)
   */
  Future<void> conformVerifyCode(map,{Success? success,Failure? failure}) async{

    await HttpUtils.instance.post('https://mrjump.po75.com:6240/Api/User/RegisterVerifyCode',
        body: map, onSuccess: success, onFailure: failure,responseType: QbResponseType.none);
  }
}
